"""
用户留言页面
"""
from selenium.webdriver.common.by import By
from page.page_base import BasePage

class UserMessge(BasePage):
    #主题定位器
    theme_locator=(By.XPATH,"/html/body/div[7]/div[2]/div/div/div/form/table/tbody/tr[2]/td[2]/input")
    #主题内容定位器
    message_content_locator=(By.XPATH,"/html/body/div[7]/div[2]/div/div/div/form/table/tbody/tr[3]/td[2]/textarea")
    #提交按钮定位器
    submit_btn_locator=(By.XPATH,"/html/body/div[7]/div[2]/div/div/div/form/table/tbody/tr[5]/td[2]/input[2]")

    #输入主题
    def inputtheme(self):
        self.driver.find_element(*self.theme_locator).send_keys("好评")
    #输入留言内容
    def inputmsgcontent(self):
        self.driver.find_element(*self.message_content_locator).send_keys("这个不错")
    #点击提交
    def submitbtn(self):
        self.driver.find_element(*self.submit_btn_locator).click()
    #断言使用
    def messagetext(self):
        now_text = self.driver.find_element(By.XPATH,"/html/body/div[7]/div[2]/div/div/div/div[2]/font").text
        return now_text